package com.neeraj.SharingArtifacts;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SharingArtifactsMain extends Activity {
	
	private static final String DEBUG_TAG = "SHARING ARTIFACTS";
	
	static final int WAIT_DIALOG_ID = 1;
	public static final int MEDIA_TYPE_IMAGE = 1;	
	
	DatabaseHelper dbHelper;
	Alerts a;
	Button aboutMeButton;
	Button buttonCamera, buttonCamcorder, buttonAudio, buttonText, buttonShowArtifacts;

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);               
        
        a = new Alerts();
        aboutMeButton = (Button)findViewById(R.id.buttonInfo);
        aboutMeButton.setOnClickListener(infoClickListener);
        
        buttonCamera = (Button)findViewById(R.id.buttonCamera);
        buttonCamera.setOnClickListener(infoClickListener);
        
        buttonCamcorder = (Button)findViewById(R.id.buttonCamcorder);
        buttonCamcorder.setOnClickListener(infoClickListener);
        
        buttonAudio = (Button)findViewById(R.id.buttonAudio);
        buttonAudio.setOnClickListener(infoClickListener);
        
        buttonText = (Button)findViewById(R.id.buttonText);
        buttonText.setOnClickListener(infoClickListener);
        
        buttonShowArtifacts = (Button)findViewById(R.id.buttonShowArtifacts);
        buttonShowArtifacts.setOnClickListener(infoClickListener);
    }
	
private OnClickListener infoClickListener = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			if(v.getId() == R.id.buttonInfo) {				
				a.ShowEmptyAlert(SharingArtifactsMain.this);
			}
			else if(v.getId() == R.id.buttonCamera) {			
				Log.d(DEBUG_TAG, "Going For Camera Activity");
				
				Intent passInfo = new Intent();				
				passInfo.setClassName("com.neeraj.SharingArtifacts", "com.neeraj.SharingArtifacts.UseCamera");
				passInfo.putExtra("", true);
				startActivityForResult(passInfo, 0);
			}
			else if(v.getId() == R.id.buttonCamcorder) {
				Log.d(DEBUG_TAG, "Going For Camcorder Activity");
				
				Intent passInfo = new Intent();				
				passInfo.setClassName("com.neeraj.SharingArtifacts", "com.neeraj.SharingArtifacts.UseCamcorder");
				passInfo.putExtra("", true);
				startActivityForResult(passInfo, 0);
			}
			else if(v.getId() == R.id.buttonAudio) {
				Log.d(DEBUG_TAG, "Going For Audio Recorder Activity");
				
				Intent passInfo = new Intent();				
				passInfo.setClassName("com.neeraj.SharingArtifacts", "com.neeraj.SharingArtifacts.RecorderActivity");
				passInfo.putExtra("", true);
				startActivityForResult(passInfo, 0);
			}
			else if(v.getId() == R.id.buttonShowArtifacts) {
				Log.d(DEBUG_TAG, "Going to Show the collected Artifacts");
				
				Intent passInfo = new Intent();				
				passInfo.setClassName("com.neeraj.SharingArtifacts", "com.neeraj.SharingArtifacts.ShowArtifactsTabs");
				passInfo.putExtra("", true);
				startActivityForResult(passInfo, 0);
			}
			else if(v.getId() == R.id.buttonText) {			
				Log.d(DEBUG_TAG, "Going For Text Activity");
				
				Intent passInfo = new Intent();				
				passInfo.setClassName("com.neeraj.SharingArtifacts", "com.neeraj.SharingArtifacts.UseText");
				passInfo.putExtra("", true);
				startActivityForResult(passInfo, 0);
			}
		}
	};
}
